/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CellWorld;

public class CellWorldPosition {
        private int x, y;

        public CellWorldPosition(int y, int x) {
                this.x = x;
                this.y = y;
        }

        public int getX() {
                return x;
        }

        public int getY() {
                return y;
        }

        @Override
        public boolean equals(Object o) {
                if (o == this) {
                        return true;
                }
                if (!(o instanceof CellWorldPosition)) {
                        return false;
                }
                CellWorldPosition cwp = (CellWorldPosition) o;
                return ((this.x == cwp.x) && (this.y == cwp.y));
        }

        @Override
        public int hashCode() {
                return x + 31 * y;
        }

        @Override
        public String toString() {
                return "< " + y + " , " + x + " > ";
        }
}
